<template>
  <div>
    <Tabbar v-model="active" active-color="#e43130">
      <TabbarItem icon="wap-home-o" >首页</TabbarItem>
      <TabbarItem icon="apps-o">分类</TabbarItem>
      <TabbarItem icon="cart-o">购物车</TabbarItem>
      <TabbarItem icon="user-o">我的</TabbarItem>
    </Tabbar>
  </div>
</template>

<script>
import { Tabbar, TabbarItem } from 'vant';
export default {
  name: 'App',
  components: {Tabbar,TabbarItem},
  data() {
    return {
    }
  },
  props: {
      active: {
          type: Number,
          default: 0
      }
  },
  watch: {
      active() {
          let url= ["/","/category","/cart","me"]
          location.href = url[this.active]
      }
  },
  methods: {

  },
  created() {
  }

}
</script>

<style scoped>

</style>
